<?php 
defined('RUN_KATANA') or die('Restricted access');
echo $commander->getListCommandsPanel('sa', '');
if(is_object($ac->getCurrentUser())):
$ac->setView('detail');
?>
<fieldset class="edit_form">
	<label for="Username"><?php echo ucfirst($txt->getWord('username')); ?></label>
    <?php echo $commander->getErrorField('Username'); ?>
    <?php echo $commander->getInfoField('Username'); ?>
    <input id="Username" name="Username" class="medium" type="text" value="<?php echo $ac->CurrentUser->getUsername(); ?>" maxlength="80" /><br />
	
	<label for="Email"><?php echo ucfirst($txt->getWord('e-mail')); ?></label>
    <?php echo $commander->getErrorField('Email'); ?>
    <?php echo $commander->getInfoField('Email'); ?>
    <input id="Email" name="Email" class="medium" type="text" value="<?php echo $ac->CurrentUser->getEmail(); ?>" maxlength="80" /><br />
	
	<label for="Group"><?php echo ucfirst($txt->getWord('user_group')); ?></label>
    <?php echo $commander->getErrorField('Group'); ?>
    <?php echo $commander->getInfoField('Group'); ?>
    <select id="Group" class="medium" name="Group" onchange="submit();">
        <option value="0" <?php echo getIsSelectedHTML($ac->CurrentUser->getGroup(), 0); ?>><?php echo ucfirst($txt->getWord('undefined')); ?></option>
        <?php 
        if($ac->getUserGroups())
        {
            foreach($ac->getUserGroups() as $group)
            { echo '<option value="'.$group->getId().'" '.$txt->getIsSelectedHTML($ac->CurrentUser->getGroup(), $group->getId()) .'>'.$group->getTitle().'</option>'; }
        }
        ?>
    </select>
	
	<label for="Level"><?php echo ucfirst($txt->getWord('access_level')); ?></label>
    <?php echo $commander->getErrorField('Level'); ?>
    <?php echo $commander->getInfoField('Level'); ?>
    <select id="Level" class="medium" name="Level" onchange="submit();">
        <option value="0" <?php echo getIsSelectedHTML($ac->CurrentUser->getLevel(), 0); ?>><?php echo ucfirst($txt->getWord('user_group').' '.$txt->getWord('defined')); ?></option>
        <?php 
        if($ac->getAccessLevels())
		{
			foreach($ac->getAccessLevels() as $level)
			{ echo '<option value="'.$level->getId().'" '.$txt->getIsSelectedHTML($ac->CurrentUser->getLevel(), $level->getId()) .'>'.$level->getId().' - '.$level->getTitle().'</option>'; }
		}
        ?>
    </select>
	<?php if($ac->getSetting('partner-accounts') > 0): ?>
    <label for="PartnerStatus"><?php echo ucfirst($txt->getWord('partner')); ?></label>
    <?php echo $commander->getErrorField('PartnerStatus'); ?>
    <?php echo $commander->getInfoField('PartnerStatus'); ?>
    <select id="PartnerStatus" class="medium" name="PartnerStatus" onchange="submit();">
        <?php 
		echo '<option value="0" '.$txt->getIsSelectedHTML($ac->CurrentUser->getPartnerStatus(), 0) .'>'.ucfirst($txt->getWord('no')).'</option>';
		if($ac->CurrentUser->getPartnerStatus() > 0)
		{ 
			echo '<option value="1" '.$txt->getIsSelectedHTML(1, $ac->CurrentUser->getPartnerStatus()) .'>'.ucfirst($txt->getWord('request').' '.$txt->getWord('sent')).'</option>'; 
			echo '<option value="5" '.$txt->getIsSelectedHTML(5, $ac->CurrentUser->getPartnerStatus()) .'>'.ucfirst($txt->getWord('standard')).' (5)'.'</option>';
			echo '<option value="15" '.$txt->getIsSelectedHTML(15, $ac->CurrentUser->getPartnerStatus()) .'>'.ucfirst($txt->getWord('pro')).' (15)'.'</option>';
			echo '<option value="10000" '.$txt->getIsSelectedHTML(10000, $ac->CurrentUser->getPartnerStatus()) .'>'.ucfirst($txt->getWord('premium')).' (*)'.'</option>';
		}
        ?>
    </select>
	<?php endif; ?>
	<hr />
	<label for="Company"><?php echo ucfirst($txt->getWord('company')); ?></label>
    <?php echo $commander->getErrorField('Company'); ?>
    <?php echo $commander->getInfoField('Company'); ?>
    <strong><?php echo $ac->CurrentUser->getCompany(); ?></strong><br />
	<?php 
	$details = new UserDetails($ac->CurrentUser);
	$details->loadDetails();
	?>
	<hr />
	<label for="Name"><?php echo ucfirst($txt->getWord('name')); ?></label>
    <?php echo $commander->getErrorField('Name'); ?>
    <?php echo $commander->getInfoField('Name'); ?>
    <strong><?php echo $details->getName(); ?></strong><br /> 
	<hr />
	<label for="Lastname"><?php echo ucfirst($txt->getWord('lastname')); ?></label>
    <?php echo $commander->getErrorField('Lastname'); ?>
    <?php echo $commander->getInfoField('Lastname'); ?>
    <strong><?php echo $details->getLastname(); ?></strong><br />
	<hr />
	<label for="Address"><?php echo ucfirst($txt->getWord('address')); ?></label>
    <?php echo $commander->getErrorField('Company'); ?>
    <?php echo $commander->getInfoField('Company'); ?>
    <strong><?php echo $details->getAddress(); ?></strong><br />
	<hr />
	<label for="Zip"><?php echo ucfirst($txt->getWord('zip')); ?></label>
    <?php echo $commander->getErrorField('Zip'); ?>
    <?php echo $commander->getInfoField('Zip'); ?>
    <strong><?php echo $details->getZip(); ?></strong><br />
	<hr />
	<label for="City"><?php echo ucfirst($txt->getWord('city')); ?></label>
    <?php echo $commander->getErrorField('City'); ?>
    <?php echo $commander->getInfoField('City'); ?>
    <strong><?php echo $details->getCity(); ?></strong><br />
	<hr />
	<label for="Phone"><?php echo ucfirst($txt->getWord('phone')); ?></label>
    <?php echo $commander->getErrorField('Phone'); ?>
    <?php echo $commander->getInfoField('Phone'); ?>
    <strong><?php echo $details->getPhone(); ?></strong><br />
	<hr />
	<label for="Mob"><?php echo ucfirst($txt->getWord('mobile')); ?></label>
    <?php echo $commander->getErrorField('Mob'); ?>
    <?php echo $commander->getInfoField('Mob'); ?>
    <strong><?php echo $details->getMob(); ?></strong><br />
	<hr />
	<label for="Fax"><?php echo ucfirst($txt->getWord('fax')); ?></label>
    <?php echo $commander->getErrorField('Fax'); ?>
    <?php echo $commander->getInfoField('Fax'); ?>
    <strong><?php echo $details->getFax(); ?></strong><br />
</fieldset>
<?php endif; ?>